import request from '@/utils/axios'
export function createComment(data:any): Promise<any> {
  return request({
    url: '/comment/comment',
    method: 'post',
    data
  })
}

export function deleteComment(id: number): Promise<any> {
  return request({
    url: `/comment/delete/${id}`,
    method: 'get'
  })
}

export function getCommentByCreateId(data: {createId: number, userId?: number, type: number, orderType?: string}): Promise<any> {
  return request({
    url: '/comment/query',
    method: 'post',
    data
  })
}

export function likeComment(id: number): Promise<any> {
  return request({
    url: `/comment/like/${id}`,
    method: 'get'
  })
}

export function unlikeComment(id: number): Promise<any> {
  return request({
    url: `/comment/unlike/${id}`,
    method: 'get'
  })
}